#!/usr/bin/env python 
# -*- coding: utf-8 -*- 
# @Time : 2018-04-19 17:27 
# @Author : Woolei
# @File : Step1_OneStep2GetData.py


"""
根据书籍的类别下载
请求页面为类别的列表页面，列表页面中的返回信息就已经包括了该书籍的所有信息
请求方式post，Ajax返回json数据
https://www.taylorfrancis.com/
"""

import facade
from xjlibrary.our_file_dir import BaseDir

curPath = BaseDir.get_file_dir_absolute(__file__)


class DownSubject(object):
    def __init__(self):
        # 所有类别
        self.logger = facade.get_streamlogger()
        self.configfile = BaseDir.get_new_path(curPath, "db.ini")
        self.mysqlutils = facade.MysqlUtiles(self.configfile, "db", logger=self.logger)

    def InitDB(self):
        sql = "Update `tbook` set `allnum`=0,`offset`=0"
        self.mysqlutils.ExeSqlToDB(sql)


if __name__ == '__main__':
    down = DownSubject()
    down.InitDB()
